import type { App, Plugin } from 'vue';
// v-md-editor 配置文件
// 基础编辑器
import VMdEditor from '@kangc/v-md-editor';
// 主题
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';

// Prism 代码高亮
// import Prism from 'prismjs';
import '@kangc/v-md-editor/lib/style/base-editor.css';
import '@kangc/v-md-editor/lib/theme/style/vuepress.css';

VMdEditor.use(vuepressTheme, {
  // Prism,
});

// 创建Vue插件包装器
const VMdEditorPlugin: Plugin = {
  install(app: App) {
    // 将VMdEditor注册为全局组件
    app.component('VMdEditor', VMdEditor);
    // 如果需要，也可以添加到全局属性
    app.config.globalProperties.$VMdEditor = VMdEditor;
  },
};

export default VMdEditorPlugin;
